package com.sistemagestion.Utils;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class Preferencia {
	
	private SharedPreferences mPreferences;
	private Context mContext;
	private static final String KEY_CRITERIO_ORDEN_CLIENTE = "ordenCliente";
	
	public static final int ORDENAR_NOMBRE = 0;
	public static final int ORDENAR_APELLIDO = 1;
	public static final int ORDENAR_DOMICILIO = 2;
	
	public Preferencia(Context context){
		mContext = context;
		mPreferences = mContext.getSharedPreferences("demo", Context.MODE_PRIVATE);
	}
	
	public int getCriterioOrdenCliente(){
		return mPreferences.getInt(KEY_CRITERIO_ORDEN_CLIENTE, 0);
	}
	
	public void setCriterioOrdenCliente(int criterio){
		Editor editor = mPreferences.edit();
		editor.putInt(KEY_CRITERIO_ORDEN_CLIENTE, criterio);
		editor.commit();
	}

}
